import React, { Component } from 'react';

import {Button} from 'antd'
import Address from './address';
class Biaogejia extends Component {
    state = {
        address: '',
        from:'111',
        dizhi:''
    }
    render() {
        // console.log(Area)
        const aaa= (h)=>{
            this.setState({
                dizhi:h.join('')
            })
        }
        return (
            <div className='oneteo'>
                <div className='abc'>
                <div className='yuan'>01</div> 
                <div className='xinxi'>填写项目信息</div>
                <div className='xian'> ------------------- </div>
                <div className='yuanteo'>02</div>
                <div className='wanc'>完成</div>
                </div>
                <div className='biga'>
                    <form action=""  >
                大棚编号: <input type="text" name='aa' placeholder='请输入大棚编号' /><br />
                种植品种: <input type="text" name='bb' placeholder='请输入品种' /><br />
                大棚地址: <Address aaa={aaa}></Address>  <br />
                大棚面积: <input type="text" name='cc' placeholder='请输入大棚面积' /><br />
                播种时间: <input type="text" name='dd' placeholder='请输入播种时间' /> <br />
                备注内容: <input type="text" name='ff' placeholder='请输入备注内容' /><br/> 
               
                   </form>
                 </div>
                 <div style={{textAlign:'center'}}> <Button onClick={()=>this.addba()} >提交</Button>
                 </div>
            </div>
        );
    }
     addba=()=>{
         var int =document.querySelectorAll('input')
         console.log(int[2].value);
        var obj= {}
        obj.key=Math.random()+''
        obj.name=int[5].value
        obj.age=int[0].value
        obj.address=this.state.dizhi
        obj.pinzhong=int[1].value
        obj.mianji=int[3].value
        obj.times=int[4].value
        this.props.fn(obj)
    }
}

export default Biaogejia;
